<?php
$app = require "config.php";

$blog = new Blog($app);

require_once 'hook.php';

$app->get("/", function() use($blog) {

	$app = $blog->getApp();
	$posts = $blog->posts();
	$app->view()->setData(compact("posts"));
	$content = $app->view()->fetch("index.php");
	$app->render("layout/default.php", array("content" => $content));

});

$app->get("/about", function () use($app)
{
	//
});

$app->get("/:title", function($title) use($blog){

	//
});

$app->run();